<template>
	<u-tabbar v-model="current" :list="list" height="55px" active-color="#FF0700" :mid-button="false" @change="change">
	</u-tabbar>
</template>
<script>
	export default {
		data() {
			return {
				t: null,
				locale: 'zh',
				list: [{
						iconPath: "home",
						selectedIconPath: "home-fill",
						text: '页1', 
					},
					{
						iconPath: "photo",
						selectedIconPath: "photo-fill",
						text: '页2',
						customIcon: false,
					},
					{
						iconPath: "chat",
						selectedIconPath: "chat-fill",
						text: '页3', 
					},
					{
						iconPath: "man",
						selectedIconPath: "man-fill",
						text: '页4', 
					},
					
					{
						iconPath: "account",
						selectedIconPath: "account-fill",
						text: '页5',
					},
					{
						iconPath: "order",
						selectedIconPath: "order-fill",
						text: '页6', 
					},
				],
				current: 0,
			}
		},
		created() {

		},

		methods: {
			change(index) { // 报错来自uni 函数非组件错误
				console.log(index);
				this.current = index
				var map = {
					0: "/pages/home/home",
					1: "/pages/publish/index",
					2: "/pages/user/index",
					3: "/pages/user/edit",
					4: "/pages/user/pages/info",
					5: "/pages/search/search",
					6: "/pages/search/detail",
					
				}
				var map = {
					 
					1: "/pages/publish/index",
					2: "/pages/user/index",
					3: "/pages/user/edit",
					4: "/pages/user/pages/info",
					0: "/pages/search/search",
					5: "/pages/search/detail",
					
				}
				uni.redirectTo({
					url: map[index]
				})
			}
		}
	}
</script>
